<?php

namespace Tests\Browser\Pages\Admin\Customer;

use Laravel\Dusk\Browser;
use Tests\Browser\Pages\Page;

class ProductTestPage extends Page
{
    /**
     * Get the URL for the page.
     *
     * @return string
     */
    public function url()
    {
        return '/web-admin/#/customer/product';
    }

    /**
     * Assert that the browser is on the page.
     *
     * @param  Browser $browser
     * @return void
     */
    public function assert(Browser $browser)
    {
//        $browser->assertPathIs($this->url());
    }

    /**
     * Get the element shortcuts for the page.
     *
     * @return array
     */
    public function elements()
    {
        return [
            '@sync_on_sale'   => '.ivu-col.ivu-col-push-2 button:first-of-type', // 在售
            '@sync_inventory' => '.ivu-col.ivu-col-push-2 button:last-of-type', // 仓库
            '@show_product'   => '.ivu-tabs-nav div:nth-last-of-type(2)', // 查看
            '@store_product'  => '.ivu-tabs-nav div:last-of-type', // 店铺商品
        ];
    }
}
